from openerp import models, fields, api

class account_analytic_account(models.Model):
    _name = 'account.analytic.account'
    _inherit = ['account.analytic.account','mail.thread']
    _description = 'Analytic Account'
    _track = {
        'state': {
            'analytic.mt_account_pending': lambda self, cr, uid, obj, ctx=None: obj.state == 'pending',
            'analytic.mt_account_closed': lambda self, cr, uid, obj, ctx=None: obj.state == 'close',
            'analytic.mt_account_opened': lambda self, cr, uid, obj, ctx=None: obj.state == 'open',
            'ky_account.mt_contract_setting': lambda self, cr, uid, obj, ctx=None: obj.state == 'draft',
            'ky_account.mt_contract_confirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'confirmed',
            'ky_account.mt_contract_marketconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'marketconfirmed',
            'ky_account.mt_contract_saleconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'saleconfirmed',
            'ky_account.mt_contract_financialconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'financialconfirmed',
            'ky_account.mt_contract_lawyerconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'lawyerconfirmed',
            'ky_account.mt_contract_managerconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'managerconfirmed',
        },
    }
